package com.fitz.demo.callback;

public class Teacher implements Callback{

    private Student student;

    public Teacher(Student student) {
        this.student = student;
    }

    public void askQuestion(String question){
        System.out.println("Teacher ask question:"+question);
        student.resolve(this,question);
    }

    @Override
    public void callback(String answer) {
        System.out.println("Student answer is : "+ answer);
    }

    public static void main(String[] args) {
        Student student = new Student();
        Teacher teacher = new Teacher(student);
        teacher.askQuestion("今天几号?");
    }
}
